package cn.com.bluemoon.daps.api.model;


import cn.com.bluemoon.daps.api.model.factory.RemoteDataModelTableIndexServiceFallbackFactory;
import cn.com.bluemoon.daps.common.constant.ServiceNameConstants.DapsApiModel;
import cn.com.bluemoon.daps.common.domain.ResultBean;
import cn.com.bluemoon.daps.model.entity.DapDataModelSubordinateKey;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;

/**
 * @author Jarod.Kong
 * @date 2020/12/21 15:49
 */
@FeignClient(value = DapsApiModel.SERVICE, fallbackFactory = RemoteDataModelTableIndexServiceFallbackFactory.class)
@RequestMapping(DapsApiModel.BASE_URI + DapsApiModel.API_MODEL_TABLE_INDEX)
@ApiIgnore
public interface RemoteDataModelTableIndexService {

    @PostMapping("/updateIndex")
    @ApiOperation(value = "更新索引信息")
    ResultBean<Boolean> updateById(@RequestParam("indexId") String id,
                                   @RequestBody DapDataModelSubordinateKey newT);

    @DeleteMapping("/delete")
    ResultBean<Boolean> removeById(@RequestParam("indexId") String id);

    @PostMapping("/saveIndex")
    @ApiOperation("保存新增索引信息")
    ResultBean<String> saveIndex(@RequestBody DapDataModelSubordinateKey newT);
}
